Relocation

This section is new as of Version 1.2 of the Conformance Guide, but will not be marked with diffmarks. The MIPS processor specific ABI specifies a Global Offset Table (GOT) which limits a DSO to 16K external references. This has proven to be a limitation for a number of developers who wish to create very large DSOs. A future version of the processor specific ABI expands the GOT. This expanded GOT is sufficiently desirable to incorporate it into Version 1.2 of this document.

The expanded GOT is defined by four new Relocation Types which are added to <elf.h>;.

		 Figure 1.  Expanded GOT Relocation Types

Name              Value   Field     Symbol          Calculation
______________________________________________________________________
R_MIPS_GOTHI16  |  22   | T-hi16 | external | (G - (short)G) >> 16 + A
________________|_______|________|__________|_________________________
R_MIPS_GOTLO16  |  23   | T-lo16 | external |  G & 0xffff
________________|_______|________|__________|_________________________
R_MIPS_CALLHI16 |  30   | T-hi16 | external | (G - (short)G) >> 16 + A
________________|_______|________|__________|_________________________
R_MIPS_CALLLO16 |  31   | T-lo16 | external |  G & 0xffff
________________|_______|________|__________|_________________________
The following paragraph replaces the third from last paragraph of Chapter 4 of the MIPS processor specific ABI. The following paragraph replaces the last paragraph of Chapter 4 of the processor specific ABI. To allow vendors flexibility in defining new relocation types for their own internal purposes, the following two definitions are added to
	#define R_MIPS_LOVENDOR   100  /* Vendor specific relocations */
	#define R_MIPS_HIVENDOR   127
Vendors are free to use any value between 100 and 127 for such internal purposes. Values in this ranges will not be used for ABI purposes in the future.

Link Editing

ISVs are cautioned that products that compile and link edit themselves after installation, or are designed to be on-site linked with end-user developed code, may inadvertently use system interfaces that are not defined by the ABI. Specifically, the headers and static libraries on the Reference Platform, not specified by the ABI, may not be compatible with those headers and libraries on all ABI vendors' platforms.

This problem occurs only when an ISV's application is link edited after installation (i.e., uses the ld command to build itself). If all executables and shared libraries are built on the Reference Platform and pass the Application Compliance Testing tool (ACT), the only possible external interfaces are those specified by the ABI. (Note that ACT does not test manifest constants, such as ioctl calls compiled into the program.) The ABI interfaces are present on all ABI conforming Operating Systems in the form of dynamic shared libraries. Thus they will be resolved through dynamic linking to the dynamic shared libraries at run-time.

In the case where an application link edits itself after installation, it may expose an incompatibility between non- ABI headers or libraries on the Reference Platform and another vendor's platform. Furthermore, vendors may change the interface or implementation of libraries not covered by the ABI in new operating system releases.

The MIPS ABI Group offers the following guidelines to ISV's whose applications must link edit after installation; they are not meant to be either exhaustive or foolproof:

Object Files

All .o files shipped with an ISV product must use position independent code, as described in chapter 3 of the System V ABI, MIPS Processor Supplement.

Debugging

Only an ELF symbol table is needed for assembly level debugging with symbols.

Compiler and Linker Options

The various platforms use different flags and switches for the compiler and linker. This is a reflection of the differences in the heritage of the compiler systems on the various machines. Platform vendors should support either the standard SVR4 Software Generation System (SGS) flags and switches or provide a wrapper function which translates these standard switches into the local equivalents. The wrappers abicc and abild have been developed to permit uniform compilation and loader flags. Vendors should provide these wrappers or equivalent functions. Some compilation systems may not support all the flags and switches that the SVR4 SGS does. Where possible the unsupported switches should be silently ignored by the wrapper or the base compilation system.

The abicc wrapper supports the following flags, many are described in more detail in the cc(SD_CMD) page in the

The abild wrapper supports the following flags, some of which are described in the ld(SD_CMD) page in the System V Interface Definition, Third Edition (SVID 3). Go to Next Chapter (Chapter 5)
Go back to the Overview
Back to the Table of Contents
Back to the MIPS ABI Home Page


Maintained by webmaster@mipsabi.org
last modified on 96/01/22

Copyright © 1995, MIPS ABI Group, Incorporated.